﻿<!DOCTYPE html>
<html>
	<meta charset="UTF-8"/>
	<head>
		<script>
			var num = 100;
			function m1(){
				num++;
				if(num == 200){
					return;
				}
				m1();
			}
			m1();
			console.log(num);

			//100!  ====  100 * 99 * 98 * 97.....
			// 100 * 99!
					// 99 * 98!

			//f(x) = x * f(x-1);

			function f(x){
				if(x==1){
					return 1;
				}
				return x * f(x-1);
			}
			console.log( f(7) );


			//斐波那契
			//1  1  2  3   5   8   13    21    34   55
			//f(x) = f(x-1) + f(x-2);  x>2
			function f(x){
				if(x <= 2) {
					return 1;
				}
				return f(x-1) + f(x-2);
			}
			console.log( f(10) );
			
		</script>
	</head>
	<body>
		
	
	</body>	
</html>











